import { Button, Form, Input } from "antd";
import { Component } from "react";
import './index.scss'
import { LockOutlined, UserOutlined } from '@ant-design/icons';

export default class Login extends Component{
  state = {

  }

  componentDidMount(){

  }

  onFinish = () => {
    this.props.history.push("/")
  }

  render(){
    return (
      <div className="login">
        <div className="center_box">
          <div className="title">SP4管理台</div>
          <Form
            onFinish={this.onFinish}
          >
            <Form.Item
              name="username"
              rules={[{ required: true, message: '请输入账号!' }]}
            >
              <Input size="large" prefix={<UserOutlined />} />
            </Form.Item>
            <Form.Item
              name="password"
              rules={[{ required: true, message: '请输入密码!' }]}
            >
              <Input.Password size="large" prefix={<LockOutlined />} />
            </Form.Item>
            <Form.Item>
              <Button className="login_btn" type="primary" htmlType="submit" size="large">登录</Button>
            </Form.Item>
          </Form>
        </div>
      </div>
    )
  }
}